# ifndef __AlanTrl_H_
# define __AlanTrl_H_

# ifdef _MSC_VER
#	pragma pack (push, 1)
# endif

const DWORD c_dwTrlSignature    = 0x38CB1200;
const DWORD c_dwTrl3FlSignature = 0x38CB1300;

const size_t c_cTrlMaxTracks = 8;
const size_t c_cTrlMaxPoints = 2500;

struct CTrlTrack {
	WORD wPoints;
	WORD wNextPoint;
	char strName [12];
	char strComment [13];

	BYTE btUnknown [3];

	DWORD dwOccupied;
	DWORD dwShow;
	DWORD dwFill;
};

struct CTrlHdr {
	DWORD dwSignature;

	WORD  wPointsInCurrentLog;
	WORD  wTracks;

	DWORD dwDate;
	DWORD dwTime;

	CTrlTrack tracks [c_cTrlMaxTracks];
};

struct CTrlPoint {
	LONG lX, lY;
};

struct CTrlExtra {
	WORD wSpeed;
	WORD wAltitude; // In 10x m.
};

struct CTrlTrackLog {
	CTrlPoint points [c_cTrlMaxPoints];
	CTrlExtra extra  [c_cTrlMaxPoints];
};

/*
struct CTrlFile {
	CTrlTrackLog logs [c_cTrlMaxTracks];
	CTrlHdr      hdr;
};*/

# ifdef _MSC_VER
#	pragma pack (pop)
# endif

# endif // __AlanTrl_H_